<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>原产地酒厂推荐</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left fs_xxi"></a>
		    <h1 class="mui-title fs_xl">{$factoryinfo.suppliers_name}</h1>
		</header>
		<include file="public/bottom_nav" />
		<div class="fs_xl mui-content act_m">
		    <div class="fac_img">
		    	<img src="{$factoryinfo.suppliers_thumb}" />
		    	<p class="fs_xl">{$factoryinfo.suppliers_name}</p>
		    </div>
		    <div class="fac_info cls">
		    	<div class="fac_info_rt">
		    		<p><span class="sp_1 fs_xl">{$factoryinfo.brand_name}</span><span class="sp_2 fs_xl">{$factoryinfo.origin_name}</span>
		    		<if $follow==1>
		    		<a id="suppliers_id" class="sp_4 fs_s active">已关注</a>
		    		<else>
		    		<a id="suppliers_id" class="sp_4 fs_s">关注</a>
		    		</if>
		    		</p>
		    		<input type="hidden" id="suppliers" value="{$factoryinfo.suppliers_id}">
		    		<p class="fs_m">香型：<span>{$factoryinfo.suppliers_aroma}</span></p>
		    	</div>
		    	<div class="fac_info_lt">
		    		<img src="{$factoryinfo.suppliers_logo}" />
		    	</div>
		    </div>
		    <div class="fac_xx">
		    	<a class="fs_s active">全部商品<span class="fs_s"></span></a>
		    	<a class="fs_s">促销活动<span class="fs_s"></span></a>
		    	<a class="fs_s">酒厂详情</a>
		    </div>
		    <div class="fac_box">
		    	<div class="fac_yc active">
		    		<if !empty($cellar_goodsList)>
		     		<div class="fac_shop">
		    		<p class="title fs_xl"><em>窖藏商品</em></p>
		    		<div class="fac_shop_list cls">
		    			<ul class="cls">
		    			<foreach name="cellar_goodsList" item="vo" key="k">
		    				<li>
	    						<a href="{:U('Cellar/goodsInfo',array('id'=>$vo.goods_id))}">
		    						<img src="{$vo.original_img}" />
		    						<p class="shop_p fs_m">{$vo.goods_name}</p>
	<!-- 								<p class="fs_xs"><i class="mui-icon iconfont icon-huangye_dianpumingcheng fs_m"></i><em>{$vo.suppliers_name}</em></p> -->
	<!-- 								<p class="fs_m"> -->
	<!-- 									<foreach name="cellartype" item='v' key='kk'><span class="span1 fs_xxs">{$v.title}</span></foreach> -->
	<!-- 									<foreach name="vo.aroma" item='v' key='kk'><span class="span2 fs_xxs">{$v.title}</span></foreach>	 -->
	<!-- 								</p> -->
									<p class="fs_m"><span class="span3 fs_xl">¥{$vo.shop_price}</span><span class="span4 fs_xxs">{$vo.sales_sum}已售</span></p>
		    					</a>
		    				</li>
						</foreach>
		    			</ul>
		    		</div>
		   			</div>
		    		</if>
		    	<if !empty($destine_goodsList)>
		     	<div class="fac_shop">
		    		<p class="title fs_xl"><em>定制商品</em></p>
		    		<div class="fac_shop_list cls">
		    			<ul class="cls">
		    			<foreach name="destine_goodsList" item="vo" key="k">
		    				<li>
		    					<a href="{:U('Destine/goodsInfo',array('id'=>$vo.goods_id))}">
		    						<img src="{$vo.original_img}" />
		    						<p class="shop_p fs_m">{$vo.goods_name}</p>
	<!-- 								<p class="fs_xs"><i class="mui-icon iconfont icon-huangye_dianpumingcheng fs_m"></i><em>{$vo.suppliers_name}</em></p> -->
	<!-- 								<p class="fs_m"> -->
	<!-- 									<foreach name="cellartype" item='v' key='kk'><span class="span1 fs_xxs">{$v.title}</span></foreach> -->
	<!-- 									<foreach name="vo.aroma" item='v' key='kk'><span class="span2 fs_xxs">{$v.title}</span></foreach>	 -->
	<!-- 								</p> -->
									<p class="fs_m"><span class="span3 fs_xl">¥{$vo.shop_price}</span><span class="span4 fs_xxs">{$vo.sales_sum}已售</span></p>
		    					</a>
		    				</li>
						</foreach>
		    			</ul>
		    		</div>
		    	</div>
		    	</if>
		    		<div class="fac_shop">
		    		<p class="title fs_xl"><em>精品特产</em></p>
		    		<div class="fac_shop_list cls">
		    			<ul class="cls">
		    			<foreach name="goodslist" item="vo" key="k">
		    				<li>
		    					<a href="{:U('Goods/goodsInfo',array('id'=>$vo.goods_id))}">
		    						<img src="{$vo.original_img}" />
		    						<p class="shop_p fs_m">{$vo.goods_name}</p>
									<p class="fs_m"><span class="span3 fs_xl">¥{$vo.shop_price}</span><span class="span4 fs_xxs">{$vo.sales_sum}已售</span></p>
		    					</a>
		    				</li>
						</foreach>
		    			</ul>
		    		</div>
		    	</div>
		    	</div>
		    	<div class="fac_yc">
		    		<div class="yac_cx fs_xl">
		    			<p>暂无促销活动！</p>
		    		</div>
		    	</div>
       			<div class="fac_js fac_yc">
		    		<p class="title fs_xl"><em>酒厂详情</em></p>
		    		{$factoryinfo.suppliers_desc}
		    	</div>
		    </div>  
		</div>
		<script type="text/javascript">
			$(".fac_shop_list li").width(($(".fac_shop_list").width()-2)*0.5);
			mui.init();
			var suppliers_id = $('#suppliers').val();
				$(".sp_4").click(function(){
					$.ajax({
						type : 'post',
						url : "{:U('Mobile/Cellar/follow')}",
						data : {suppliers_id:suppliers_id},
						dataType : 'json',
						success : function(res){
							if(res.status == 1){
								$(".sp_4").addClass("active");
								$(".sp_4").text("已关注");
							}else if(res.status==2){
								$(".sp_4").removeClass("active");
								$(".sp_4").text("关注");
							}else if(res.code == 0){
								window.location.href="{:U('Mobile/User/login')}";
							}else{	
								showErrorMsg(res.msg);
							}
						},
					})

				})
			$(function(){
				$(".fac_xx a").click(function () {
        			$(".fac_xx a").removeClass("active").eq($(".fac_xx a").index(this)).addClass("active");
        			$(".fac_yc").hide().eq($('.fac_xx a').index(this)).show();
    			});
			})
		</script>
	</body>

</html>
